package com.iting.test;

import com.iting.test.properties.MyProperties;
import com.iting.test.template.MyTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author iting Nie
 * @version 1.1
 * @create 2022/1/14
 */
@Configuration
@EnableConfigurationProperties(MyProperties.class)
public class MyAutoConfigDemo {
	@Bean
	@ConditionalOnMissingBean
	public MyTemplate myTemplate(MyProperties myProperties){
		System.out.println("配置类的");
		return new MyTemplate(myProperties);
	}



}
